snippet lpr
  pr_info("[martins3:%s:%d] ${0}\n", __FUNCTION__, __LINE__);

snippet qpr
  printf("[martins3:%s:%d] ${0}\n", __FUNCTION__, __LINE__);

snippet seapr
  dprintf(1, "[martins3:%s:%d] ${0}\n", __FUNCTION__, __LINE__);

snippet import "template"
  #include <assert.h>  // assert
  #include <errno.h>   // strerror
  #include <fcntl.h>   // open
  #include <limits.h>  // INT_MAX
  #include <math.h>    // sqrt
  #include <stdbool.h> // bool false true
  #include <stdio.h>
  #include <stdlib.h>  // malloc sort
  #include <string.h>  // strcmp
  #include <unistd.h>  // sleep

  int main(int argc, char *argv[]) {
  	${0}
  	return 0;
  }

snippet sysfs "add monitor into sysfs"
  int foo;
  EXPORT_SYMBOL(foo);
  static ssize_t foo_show(struct kobject *kobj, struct kobj_attribute *attr,
  			char *buf)
  {
  	return sysfs_emit(buf, "%d\n", foo);
  }

  static ssize_t foo_store(struct kobject *kobj, struct kobj_attribute *attr,
  			 const char *buf, size_t count)
  {
  	int ret;

  	ret = kstrtoint(buf, 10, &foo);
  	if (ret < 0)
  		return ret;

  	return count;
  }

  static struct kobj_attribute foo_attribute =
  	__ATTR(foo, 0664, foo_show, foo_store);

  static struct attribute *attrs[] = {
  	&foo_attribute.attr,
    NULL,
  };

  static struct attribute_group attr_group = {
  	.attrs = attrs,
  };

  static struct kobject *mymodule;
  static int greeter_init(void)
  {
  	int error = 0;
  	mymodule = kobject_create_and_add("hacking", kernel_kobj);
  	if (!mymodule)
  		return -ENOMEM;

  	error = sysfs_create_group(mymodule, &attr_group);
  	if (error)
  		kobject_put(mymodule);

  	return error;
  }
